# Author:: Alexandre Ribeiro de Souza (<alexandre@lumis.com.br>)

name "saas"
description "Lumis SAAS Role."
env_run_lists(
  "_default" => [
    "role[base]",
    "recipe[lumis_aws::ebs]",
    "recipe[lumis_aws::create_s3]",
    "recipe[lumis_aws::s3tools]",
    "recipe[lumis_users::systemuser]",
    "recipe[lumis_iptables::disabled]",
    "recipe[selinux::disabled]",
    "recipe[java]",
    "recipe[nfs::server]",
    "recipe[lumis_idmap]",
    "recipe[lumis_mysql]",
    "recipe[lumis_tomcat6]",
    "recipe[lumis_lumisportal::createlocalmysqldb]",
    "recipe[lumis_lumisportal::install]",
    "recipe[nfs::exports]",
    "recipe[lumis_lumisportal::client]",
    "recipe[lumis_lumisportal::associate_tomcat6]",
    "recipe[lumis_apache2]",
    "recipe[lumis_backup]",
    "recipe[lumis_backup::monitoring]",
    "recipe[lumis_aws::elastic_ip]"
  ],
  "saas-dev" => [
    "role[base]",
    "recipe[lumis_aws::create_s3]",
    "recipe[lumis_aws::s3tools]",
    "recipe[lumis_users::systemuser]",
    "recipe[lumis_iptables::disabled]",
    "recipe[selinux::disabled]",
    "recipe[java]",
    "recipe[lumis_mysql]",
    "recipe[lumis_tomcat6]",
    "recipe[lumis_lumisportal::createlocalmysqldb]",
    "recipe[lumis_lumisportal::install]",
    "recipe[lumis_lumisportal::client]",
    "recipe[lumis_lumisportal::associate_tomcat6]",
    "recipe[lumis_apache2]",
    "recipe[lumis_backup::monitoring]"
  ],
  "saas-db" => [
    "role[base]",
    "recipe[lumis_aws::ebs]",
    "recipe[lumis_aws::create_s3]",
    "recipe[lumis_aws::s3tools]",
    "recipe[lumis_users::systemuser]",
    "recipe[lumis_iptables::disabled]",
    "recipe[selinux::disabled]",
    "recipe[java]",
    "recipe[nfs::server]",
    "recipe[lumis_idmap]",
    "recipe[lumis_mysql]",
    "recipe[lumis_tomcat6]",
    "recipe[lumis_lumisportal::createlocalmysqldb]",
    "recipe[lumis_lumisportal::install]",
    "recipe[nfs::exports]",
    "recipe[lumis_backup]",
    "recipe[lumis_backup::monitoring]",
    "recipe[lumis_aws::elastic_ip]"
  ],
  "saas-app" => [
    "role[base]",
    "recipe[lumis_users::systemuser]",
    "recipe[lumis_iptables::disabled]",
    "recipe[selinux::disabled]",
    "recipe[java]",
    "recipe[nfs]",
    "recipe[lumis_idmap]",
    "recipe[lumis_tomcat6]",
    "recipe[lumis_lumisportal::client]",
    "recipe[lumis_lumisportal::associate_tomcat6]",
    "recipe[lumis_apache2]",
    "recipe[lumis_backup::monitoring]"
  ]
)
override_attributes(
  "java" => {
    "install_flavor" => "oracle",
    "jdk_version" => "6",
    "jdk" => {
      "6" => {
        "x86_64" => {
          "url" => "http://s3.amazonaws.com/lumis/install/jdk-6u31-linux-x64.bin",
          "checksum" => "0219d4feeedb186e5081ab092dfcda20c290fde5463f9a707e12fd63897fd342"
        }
      }
    }
  },
  "lumis" => {
    "tomcat6" => {
      "java_opts" => "-Xms4g -Xmx4g -Djava.awt.headless=true"
    }
  },
  "apache" => {
    "contact" => "suporte@lumis.com.br"
  },
  "nfs" => {
    "exports" => [ "/mnt/lumis/lumisportal 10.0.0.0/8(rw,sync,secure,no_root_squash)" ]
  }
)
